home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 203_01 / ymodem.doc < prev   
Text File  |  1980-01-01  |  45KB  |  1,460 lines

  1.  
  2.  
  3.  
  4.                                   - 1 -
  5.  
  6.  
  7.  
  8.                      XMODEM/YMODEM PROTOCOL REFERENCE
  9.                  A compendium of documents describing the
  10.                             XMODEM and YMODEM
  11.                          file transfer Protocols
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.                          Edited by Chuck Forsberg
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.                  Please distribute as widely as possible.
  39.  
  40.                        Questions to Chuck Forsberg
  41.  
  42.  
  43.  
  44.  
  45.  
  46.                            Omen Technology Inc
  47.                         17505-V Sauvie Island Road
  48.                           Portland Oregon 97231
  49.                            Voice: 503-621-3406
  50.             Modem (Telegodzilla): 503-621-3746 Speed 1200,300
  51.                           Compuserve: 70715,131
  52.                     UUCP: ...!tektronix!reed!omen!caf
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61. XMODEM/YMODEM Protocol Reference                                         1
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.                                   - 2 -
  71.                                                                  Chapter 1
  72.  
  73.  
  74. 1.  TOWER OF BABEL ??
  75.  
  76. In the interest of fostering compatibility among communications programs,
  77. part of of the Professional-YAM manual is reproduced here to minimize the
  78. Electronic Tower of Babel.
  79.  
  80. The YMODEM Protocol is supported by the public domain programs YAM (CP/M),
  81. YAM(CP/M-86), YAM(CCPM-86), rb/sb (Unix, Berkeley Unix, Venix, Xenix,
  82. Coherent, IDRIS, Regulus) as well as Professional-YAM.  These programs
  83. have been in use since 1981.
  84.  
  85. The protocols described below are enhancements to Ward Christensen's
  86. XMODEM protocol, and are public domain.
  87.  
  88. The 1k packet length capability described below may be used in conjunction
  89. with the Batch Protocol, or with single file transfers identical to the
  90. XMODEM/CRC protocol except for minimal changes to support 1k packets.
  91.  
  92. To complete this tome, Ward Christensen's original protocol document and
  93. John Byrns's CRC-16 document are included for reference.
  94.  
  95. References to the MODEM or MODEM7 protocol have been changed to XMODEM to
  96. accommodate the vernacular.
  97.  
  98. Watch for an article describing the YMODEM protocol in a more coherent
  99. fashion later this year.  This article will include some interesting
  100. history on the development of file microcomputer file transfers.
  101.  
  102.  
  103. 1.1  Some Messages from the Pioneer
  104.  
  105. #: 130940 S0/Communications 25-Apr-85  18:38:47
  106. Sb: my protocol
  107. Fm: Ward Christensen 76703,302 (EDITED)
  108. To: all
  109.  
  110.  
  111. Be aware the article1 DID quote me correctly in terms of the phrases like
  112. "not robust", etc.
  113.  
  114. It was a quick hack I threw together, very unplanned (like everything I
  115. do), to satisfy a personal need to communicate with "some other" people.
  116.  
  117. ONLY the fact that it was done in 8/77, and that I put it in the public
  118. domain immediately, made it become the standard that it is.
  119.  
  120.  
  121. __________
  122.  
  123.  1. Infoworld April 29 p. 16
  124.  
  125.  
  126.  
  127. 2                           Vsn 13.09 05-05-85              TurboDial 1.02
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.                                   - 3 -
  137. Chapter 1
  138.  
  139.  
  140. I think its time for me to
  141.  
  142. (1) document it; (people call me and say "my product is going to include
  143. it - what can I 'reference'", or "I'm writing a paper on it, what do I put
  144. in the bibliography") and
  145.  
  146. (2) propose an "incremental extension" to it, which might take "exactly"
  147. the form of Chuck Forsberg's YAM protocol.  He wrote YAM in C for CP/M and
  148. put it in the public domain, and wrote a batch protocol for Unix called rb
  149. and sb (receive batch, send batch), which was basically XMODEM with
  150.    (a) a record 0 containing filename date time and size
  151.    (b) a 1K block size option
  152.    (c) CRC-16.
  153.  
  154. He did some clever programming to detect false ACK or EOT, but basically
  155. left them the same.
  156.  
  157. People who suggest I make SIGNIFICANT changes to the protocol, such as
  158. "full duplex", "multiple outstanding blocks", "multiple destinations", etc
  159. etc don't understand that the incredible simplicity of the protocol is one
  160. of the reasons it survived to this day in as many machines and programs as
  161. it may be found in!
  162.  
  163. Consider the PC-NET group back in '77 or so - documenting to beat the band
  164. - THEY had a protocol, but it was "extremely complex", because it tried to
  165. be "all things to all people" - i.e. send binary files on a 7-bit system,
  166. etc.  I was not that "benevolent". I (emphasize > I < ) had an 8-bit UART,
  167. so "my protocol was an 8-bit protocol", and I would just say "sorry" to
  168. people who were held back by 7-bit limitations.
  169. ...
  170. Block size: Chuck Forsberg created an extension of my protocol, called
  171. YAM, which is also supported via his public domain programs for UNIX
  172. called rb and sb - receive batch and send batch.  They cleverly send a
  173. "block 0" which contains the filename, date, time, and size.
  174. Unfortunately, its UNIX style, and is a bit weird2 - octal numbers, etc.
  175. BUT, it is a nice way to overcome the kludgy "echo the chars of the name"
  176. introduced with MODEM7.  Further, chuck uses CRC-16 and optional 1K
  177. blocks.  Thus the record 0, 1K, and CRC, make it a "pretty slick new
  178. protocol" which is not significantly different from my own.
  179.  
  180. Also, there is a catchy name - YMODEM.  That means to some that it is the
  181. "next thing after XMODEM", and to others that it is the Y(am)MODEM
  182. protocol.  I don't want to emphasize that too much - out of fear that
  183. other mfgrs might think it is a "competitive" protocol, rather than an
  184.  
  185.  
  186. __________
  187.  
  188.  2. The Unix style stuff (time, file mode) is optional.  The pathname and
  189.     file length may be sent alone if desired.
  190.  
  191.  
  192.  
  193. XMODEM/YMODEM Protocol Reference                                         3
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.                                   - 4 -
  203.                                                                  Chapter 1
  204.  
  205.  
  206. "unaffiliated" protocol.  Chuck is currently selling a much-enhanced
  207. version of his CP/M-80 C program YAM, calling it Professional Yam, and its
  208. for the PC - I'm using it right now.  VERY slick!  32K capture buffer,
  209. script, scrolling, previously captured text search, plus built-in commands
  210. for just about everything - directory (sorted every which way), XMODEM,
  211. YMODEM, KERMIT, and ASCII file upload/download, etc.  You can program it
  212. to "behave" with most any system - for example when trying a number for
  213. CIS it detects the "busy" string back from the modem and substitutes a
  214. diff phone # into the dialing string and branches back to try it.
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259. 4                           Vsn 13.09 05-05-85              TurboDial 1.02
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.                                   - 5 -
  269. Chapter 2                                     XMODEM Protocol Enhancements
  270.  
  271.  
  272. 2.  XMODEM PROTOCOL ENHANCEMENTS
  273.  
  274. Professional-YAM uses several compatible extensions and logic enhancements
  275. to the widely used Ward Christensen XMODEM protocol.
  276.  
  277. This chapter discusses the protocol extensions to Ward Christensen's 1982
  278. XMODEM protocol description document.
  279.  
  280. YAM does not ask the operator whether he wishes to keep retrying after 10
  281. attempts have failed to correctly transfer a packet.  Virtually all
  282. correctable errors are corrected within the first few retransmissions.  If
  283. the line is so bad that ten attempts are insufficient, there is a
  284. significant danger of undetected errors.  In that case, it's better to
  285. redial for a better connection.
  286.  
  287.  
  288. 2.1  CAN-CAN Abort
  289.  
  290. YAM recognizes a sequence of two consecutive CAN (Hex 18) characters
  291. without modem errors (overrun, framing, etc.) as a transfer abort
  292. command.1 The check for two consecutive CAN characters virtually
  293. eliminates the possibility of a line hit aborting the transfer.  YAM sends
  294. five CAN characters when it aborts a XMODEM protocol file transfer,
  295. followed by five backspaces to delete the CAN characters from the remote's
  296. keyboard input buffer (in case the remote had already aborted the
  297. transfer).
  298.  
  299.  
  300. 2.2  CRC-16 Option
  301.  
  302. The XMODEM protocol uses an optional two character CRC-16 instead of the
  303. one character arithmetic checksum used by the original protocol and by
  304. most commercial implementations.  CRC-16 guarantees detection o